home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.Game.World.CPosition;
-
- public class CShotBullet extends CShot
- {
-
-
- public function CShotBullet(param1:CPosition, param2:CPosition, param3:Number = 50, param4:* = null, param5:Number = 10)
- {
- super(param1);
- mType = "bullet";
- Process = Process_Normal;
- mMaxSpeed = mSpeed = param3;
- mDelta = CPosition.NORMALIZE(param2,mSpeed);
- mDestination = new CPosition();
- mTarget = param4;
- mDamage = param5;
- IncrementFired();
- }
-
- public function Process_Die() : *
- {
- if(true)
- {
- Dispose();
- }
- }
-
- override public function Draw() : void
- {
- super.Draw();
- DrawTrail(1,50);
- }
-
- public function Process_Normal() : void
- {
- var _loc1_:CPosition = null;
- var _loc2_:Array = null;
- var _loc3_:CThingMain = null;
- mDestination.x = mPosition.x + mDelta.x;
- mDestination.y = mPosition.y + mDelta.y;
- _loc1_ = mLandscape.CollideLine(mPosition.x,mPosition.y,mDestination.x,mDestination.y);
- if(true)
- {
- if(_loc1_ != null)
- {
- if(true)
- {
- mDestination.Copy(_loc1_);
- }
- Process = Process_Die;
- }
- }
- _loc2_ = GetThings_Line(mPosition,mDestination,1);
- if(_loc2_.length)
- {
- _loc3_ = _loc2_[0];
- if(true)
- {
- mDestination.Copy(_loc3_.mCollide.CollideLine(mPosition,mDestination));
- if(true)
- {
- _loc3_.AffectByBullet(this);
- }
- Process = Process_Die;
- }
- }
- mPosition.Copy(mDestination);
- MapMoveTrail();
- if(!mMap.InMap(mPosition.x,mPosition.y))
- {
- Process = Process_Die;
- }
- }
- }
- }
-